package com.open.capacity.notice.dto;

import java.io.Serializable;
import java.util.Map;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.open.capacity.common.validator.UpdateGroup;
import com.open.capacity.notice.enums.RececiverType;
import com.open.capacity.notice.enums.SendMessageJobStatus;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 消息任务
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SuppressWarnings("all")
public class SendMessageJobDto implements Serializable {

	@ApiModelProperty(value = "编号")
	@NotBlank(groups = UpdateGroup.class,message = "id不能为空")
	private String id;

	@ApiModelProperty(value = "任务名称")
	@NotBlank(message = "任务名称不能为空")
	@Length(max = 100, message = "超过任务名称最大长度")
	private String jobName;

	@ApiModelProperty(value = "关联消息模板")
	@NotBlank(message = "消息模板不能为空")
	@Length(max = 100, message = "超过消息模板最大长度")
	private String templateId;

	@ApiModelProperty(value = "模板变量")
	private String variables;
	
	@ApiModelProperty(value = "个性配置变量")
	private Map<String, String> extendInfo;


	@ApiModelProperty(value = "接收类型:消息的发送ID类型：1.接收组 2.userId 3.手机号 4.微信")
	private RececiverType receciverType;

	@ApiModelProperty(value = "接收组")
	@NotBlank(message = "接收组不能为空")
	@Length(max = 100, message = "超过接收组最大长度")
	private String receciver;

	@ApiModelProperty(value = "触发类型")
	@NotNull(message = "触发类型不能为空")
	private Boolean timer;

	@ApiModelProperty(value = "cron表达式")
	private String cron;

	@ApiModelProperty(value = "屏蔽类型")
	@NotNull(message = "屏蔽类型不能为空")
	private Boolean shield;

	@ApiModelProperty(value = "屏蔽时间")
	private String shieldTime;

	private SendMessageJobStatus status;


}
